package com.blog.personalblog.mapper;

import com.blog.personalblog.entity.User;
import com.blog.personalblog.entity.response.ServiceResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户Mapper
 */
@Mapper
@Repository
public interface UserMapper {
    /**
     * 查询所有用户
     * @return
     */
    List<User> findAll();
    /**
     * 添加新用户
     * @param user
     * @return
     */
    boolean insertUser(@Param("user")User user);
    /**
     * 批量添加新用户
     * @param user
     * @return
     */
    boolean batchInsert(@Param("user")User user);
    /**
     * 更新用户信息
     * @param user
     * @return
     */
    boolean updateUser(@Param("user")User user);
    /**
     * 根据id删除用户信息
     * @param id
     * @return
     */
    int deleteUser(int id);
}
